
* Change directory
* cd "C:\Users\omeryair88\Desktop"

*******************
** Main analyses **
*******************

*** Table 2  ***

* Model 1 - Feeling thermometer (warmth) toward the outgroup
reg outgroup_warmth expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise
outreg2 using Table_2.doc, replace se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 2 - Ascription of positive traits for outgroup
reg positivetraits_outgroup expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_2.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 3 - Social distance (marriage) to outgroup
reg outgroup_marriage expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_2.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 4 - Trust of outgroup
reg outgroup_trust expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_2.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)  

* Model 5 - Outgroup scale
reg outgroup_scale expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_2.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)  



************************************************
** Additional tests - for the Online Appendix **
************************************************

*** Table D5 - Manipulation checks for Study 2 ***
* Model 1 - Change in the perceptions of how the outgroup rates the ingroup
reg change_perc_outgroup_of_ingroup expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise  
outreg2 using Table_D5.doc, replace se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 2 - Change in the perceptions of how the ingroup rates the outgroup
reg change_perc_ingroup_of_outgroup expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 3 - Change in the perceptions of outgroup's attitudes toward the Border Wall
* (i.e., whether the outgroup is moderating on the Border Wall)
reg outparty_wall expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 4 - Change in the perceptions of ingroup's attitudes toward the Border Wall
* (i.e., whether the ingroup is moderating on the Border Wall)
reg inparty_wall expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 5 - Change in the perceptions of outgroup's attitudes toward DACA
* (i.e., whether the outgroup is moderating on DACA)
reg outparty_DACA expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 6 - Change in the perceptions of ingroup's attitudes toward DACA
* (i.e., whether the ingroup is moderating on DACA)
reg inparty_DACA expt_friendly expt_both_compromise expt_only_own_compromise expt_only_other_compromise
outreg2 using Table_D5.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 



*** Table D6 ***
** Table 2 - the two experimental factors interacted **

* Model 1 - Feeling thermometer (warmth) toward the outgroup
reg outgroup_warmth i.expt_friendly##i.issues_factor_2 
outreg2 using Table_D6.doc, replace se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 2 - Ascription of positive traits for outgroup
reg positivetraits_outgroup i.expt_friendly##i.issues_factor_2 
outreg2 using Table_D6.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 3 - Social distance (marriage) to outgroup
reg outgroup_marriage i.expt_friendly##i.issues_factor_2 
outreg2 using Table_D6.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 4 - Trust of outgroup
reg outgroup_trust i.expt_friendly##i.issues_factor_2 
outreg2 using Table_D6.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 5 - Outgroup scale
reg outgroup_scale i.expt_friendly##i.issues_factor_2 
outreg2 using Table_D6.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 



*** Table D7 ***
** Table 2 - separate analyses among Dems. and Reps. **

* Model 1 - warmth among Dems.
reg outgroup_warmth expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==0 
outreg2 using Table_D7.doc, replace se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 2 - warmth among Reps.
reg outgroup_warmth expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==1 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 3 - traits among Dems.
reg positivetraits_outgroup expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==0 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 4 - traits among Reps.
reg positivetraits_outgroup expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==1 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 5 - marriage among Dems.
reg outgroup_marriage expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==0 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 6 - marriage among Reps.
reg outgroup_marriage expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==1 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 7 - Trust among Dems.
reg outgroup_trust expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==0 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 8 - Trust among Reps.
reg outgroup_trust expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==1 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)

* Model 9 - Outgroup scale among Dems..
reg outgroup_scale expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==0 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 10 - Outgroup scale among Reps.
reg outgroup_scale expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise if republican==1 
outreg2 using Table_D7.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)



*** Table D8 - analyses of results of the ingroup scale ***
* Model 1 - Ingroup scale
reg ingroup_scale expt_friendly expt_both_compromise ///
expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_D8.doc, replace se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 2 - Ingroup scale - interaction b/w friendly cond. and partisan social identity
reg ingroup_scale i.expt_friendly##c.partisan_soc_iden_w1 ///
expt_both_compromise expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_D8.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 3 - Ingroup scale - interactions 'compromise factor' b/w and immigration scale
reg ingroup_scale expt_friendly ///
i.expt_both_compromise##c.immigration_scale_ingroup_w1 ///
i.expt_only_own_compromise##c.immigration_scale_ingroup_w1 ///
i.expt_only_other_compromise##c.immigration_scale_ingroup_w1 
outreg2 using Table_D8.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 



*** Table D9 ***
** Table 2 with moderators (partisan social identity; immigration scale) **

* Model 1 - Outgroup scale - w. partisan social identity 
reg outgroup_scale i.expt_friendly##c.partisan_soc_iden_w1 ///
expt_both_compromise expt_only_own_compromise expt_only_other_compromise
outreg2 using Table_D9.doc, replace se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 2 - Outgroup scale - w. immigration scale
reg outgroup_scale expt_friendly ///
i.expt_both_compromise##c.immigration_scale_ingroup_w1 ///
i.expt_only_own_compromise##c.immigration_scale_ingroup_w1 ///
i.expt_only_other_compromise##c.immigration_scale_ingroup_w1 
outreg2 using Table_D9.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +)



*** Table D10 - Table 2 with conflict avoidance ***
* Model 1 - Outgroup scale - w. conflict avoidance 
gen conflict_avoid=1-conflict_welcoming_w1
reg outgroup_scale i.expt_friendly##c.conflict_avoid ///
expt_both_compromise expt_only_own_compromise expt_only_other_compromise 
outreg2 using Table_D10.doc, replace se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 

* Model 2 - Outgroup scale - w. conflict avoidance
reg outgroup_scale expt_friendly ///
i.expt_both_compromise##c.conflict_avoid ///
i.expt_only_own_compromise##c.conflict_avoid ///
i.expt_only_other_compromise##c.conflict_avoid 
outreg2 using Table_D10.doc, append se dec(2) alpha (.01, .05, .1) symbol (**, *, +) 
drop conflict_avoid




***********************************************
*** Interactions b/w factors - for Figure 2 ***
***********************************************

reg outgroup_scale i.expt_friendly##i.issues_factor_2 
margin i.issues_factor_2##i.expt_friendly, level(95)
margin i.issues_factor_2##i.expt_friendly, level(95)
*marginsplot


